{% extends 'layout.html' %}
{% load static %}
{% block css %}
    <link rel="stylesheet" href="{% static 'plugins/bootstrap-datepicker-722dc29/dist/css/bootstrap-datepicker.min.css' %}">
{% endblock %}
{% block content %}
    <div class="container">
        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title"> 新建用户 </h3>
          </div>
          <div class="panel-body">
                <form method="post">
                    {% csrf_token %}
                  <div class="form-group">
                        <label>姓 名</label>
                        <input type="text" class="form-control" placeholder="姓 名" name="name">
                  </div>
                  <div class="form-group">
                        <label>密 码</label>
                        <input type="text" class="form-control" placeholder="密 码" name="pwd">
                  </div>
                  <div class="form-group">
                        <label>年 龄</label>
                        <input type="text" class="form-control" placeholder="年 龄" name="age">
                  </div>
                  <div class="form-group">
                        <label>余 额</label>
                        <input type="text" class="form-control" placeholder="余 额" name="account">
                  </div>
                  <div class="form-group">
                        <label>入职时间</label>
                        <input type="text" id="example-datepicker" class="form-control" placeholder="入职时间" name="create_time">
                  </div>
                  <div class="form-group">
                        <label>部 门</label>
                        <select class="form-control"  name="depart">
                                {% for obj in context.department %}
                                    <option value="{{ obj.id }}">{{ obj.title }}</option>
                                {% endfor %}
                        </select>
                  </div>
                  <div class="form-group">
                        <label>性 别</label>
                        <select class="form-control"  name="gender">
                            {% for item in context.gender_choices %}
                                <option value="{{ item.0 }}">{{ item.1 }}</option>
                            {% endfor %}
                        </select>
                  </div>
                  <button type="submit" class="btn btn-primary">提 交</button>
                </form>
          </div>
        </div>
    </div>
{% endblock %}
{% block js %}
   <script src="{% static 'plugins/bootstrap-datepicker-722dc29/dist/js/bootstrap-datepicker.min.js' %}"></script>
    <script src="{% static 'plugins/bootstrap-datepicker-722dc29/dist/locales/bootstrap-datepicker.zh-CN.min.js' %}"></script>
    <script>
     // 选择日期
        jQuery('#example-datepicker').each(function () {
            var $input = jQuery(this);
            $input.datepicker({
                todayHighlight: true,
                defaultViewDate:'today',
                language: 'zh-CN',
                    });
                });

    </script>
{% endblock %}